/**
 * 
 */
package org.statewalker.validator.impl;

import org.statewalker.validator.IParseKey;
import org.statewalker.validator.IParseState;

public class ParseState implements IParseState {

    protected IParseKey fKey;

    public ParseState(IParseKey key) {
        fKey = key;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this)
            return true;
        if (!(obj instanceof ParseState))
            return false;
        ParseState o = (ParseState) obj;
        return fKey.equals(o.fKey);
    }

    /**
     * @see org.statewalker.validator.IParseState#getKey()
     */
    public IParseKey getKey() {
        return fKey;
    }

    /**
     * @see org.statewalker.validator.IParseState#getName()
     */
    public String getName() {
        return fKey.getName();
    }

    @Override
    public int hashCode() {
        return fKey.hashCode();
    }

    @Override
    public String toString() {
        return fKey.getName();
    }
}